home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK1.toast / Development Kits (Disc 1) / QuickDraw GX / Programming Stuff / Sample Code / Printing Samples / Printer Drivers… / ImageWriterLQ (alt. rdip) / ChooserSupport.r < prev    next >
Encoding:
Text File  |  1996-06-15  |  7.7 KB  |  291 lines  |  [TEXT/MPS ]

  1. /* ------------------------------------------------------------------------------
  2. FILENAME
  3.     ChooserSupport.r
  4.  
  5. DESCRIPTION
  6.     This module contains the ImageWriter LQ constants, types, and resources that
  7.     are needed in order for the driver to work with the Chooser.
  8.             
  9.     Note: all resources should be designated to load into the system heap.
  10.  
  11. COPYRIGHT
  12.      Copyright Apple Computer, Inc. 1992-1996
  13.      All rights reserved. 
  14.     
  15.     12/20/93 - dmh - Sync'd with the shipping 1.0b3 GX driver.
  16.      8/28/94 - dmh - Sync'd with the shipping 1.0.1 GX driver.
  17.      6/14/96 - cn  - Updated to support Universal Interfaces 2.1.
  18.  
  19. -------------------------------------------------------------------------------- */
  20.  
  21. // System 7.0 Compatible
  22. #define SystemSevenOrLater        1
  23.  
  24. // Include System Resource Definitions
  25. #include "Types.r"
  26. #include "SysTypes.r"
  27.  
  28. // Include the ImageWriter LQ driver constants that are used in the resources 
  29. #include "LQResources.h"
  30.  
  31. // Include the public QuickDraw GX printing files 
  32. #include "GXPrintingResTypes.r"
  33.  
  34. // Include the ImageWriter LQ Driver's LDEF and PACK Code Segments ===== */
  35.  
  36. include "IWLQ_PACK";
  37. include "IWLQ_LDEF";
  38.  
  39.  
  40. /*********************************************************************************************
  41.      THINGS TO CONTROL THE DEFAULT CHOOSING MECHANSIM
  42. *********************************************************************************************/
  43.  
  44. // The 'look' resource is used by the driver's PACK to know how to communicate 
  45. // to the device.  This resource contains the default settings, as the actual value 
  46. // can be found in the desktop printer. 
  47.  
  48. resource 'look' (kLookRsrcID, sysheap, purgeable) 
  49. {
  50.     2,                                    // use the first in our list by default
  51.     {
  52.         "AppleTalk",    kPAPCommRsrcID,                isAppleTalk,                        "LQ";
  53.         "Serial",        kSerialCommRsrcID,            iconCells,                            "Modem Port";
  54.         "Servers",        kPrinterShareCommRsrcID,    isAppleTalk+isPrinterShare,    "ImageWriterLQIS";
  55.     };
  56. };
  57.  
  58.  
  59. // This 'comm' resource defines the default communication settings when using this 
  60. // driver with PrinterShare. 
  61.  
  62. resource 'comm' (kPrinterShareCommRsrcID, sysheap, purgeable)
  63. {
  64.     PrinterShare
  65.     {
  66.         "",
  67.         0
  68.     };
  69. };
  70.  
  71.  
  72. // This 'comm' resource defines the default communication settings when using this 
  73. // driver with PAP communications. 
  74.  
  75. resource 'comm' (kPAPCommRsrcID, sysheap, purgeable) 
  76. {
  77.     PAP
  78.     {
  79.         1,
  80.         "",
  81.         0, 0, 0, 0
  82.     };
  83. };
  84.  
  85.  
  86. // This 'comm' resource defines the default communication settings when using this 
  87. // driver with direct Serial communications. 
  88.  
  89. resource 'comm' (kSerialCommRsrcID, sysheap, purgeable)
  90. {
  91.     Serial
  92.     {
  93.         baud19200,        /* Output baud rate */
  94.         noParity,        /* Output parity */
  95.         oneStop,            /* Output stop bits */
  96.         data8,            /* Output data size */
  97.         0x00010000,        /* Output handshaking (hardware handshaking) */
  98.         0x00000000,
  99.         baud19200,        /* Input baud rate */
  100.         noParity,        /* Input parity */
  101.         oneStop,            /* Input stop bits */
  102.         data8,            /* Input data bits */
  103.         0,                    /* Input handshaking */
  104.         0,
  105.         1024,                /* Input buffer size */
  106.         ".AIn",            /* Input driver name */
  107.         ".AOut"            /* Output driver name */
  108.     };
  109. };
  110.     
  111.  
  112. /*********************************************************************************************
  113.     STANDARD CHOOSER PACK STUFF
  114. *********************************************************************************************/
  115.  
  116.  
  117. // NBP Lookup type (maxed out so resource file won't need updating)
  118. resource 'STR ' (-4096, sysheap, purgeable)
  119. {
  120.     "XXXXXXXXXXXXXXXXXXXXXX";
  121. };
  122.  
  123. // NBP timeout value
  124. type 'GNRL'
  125. {
  126.     byte;    // timeout
  127.     byte;    // retries
  128. };
  129.  
  130. resource 'GNRL' (-4096, sysheap, purgeable)
  131. {
  132.     11,
  133.     5
  134. };
  135.  
  136. // title string (we'll put a control here, so we don't want a title)
  137. resource 'STR ' (-4091, sysheap, purgeable)
  138. {
  139.     "";
  140. };
  141.  
  142. // "left" button title
  143. resource 'STR ' (-4093)
  144. {
  145.     "Create";
  146. };
  147.  
  148. // rectangle list
  149. resource 'nrct' (-4096, sysheap, purgeable) {
  150.     {
  151.     {112, 251, 132, 311};            // left button
  152.     {0,0,0,0};                            // right button
  153.     {-101, 180, -101+20, 400};        // on button (location of device list - popup is placed here)
  154.     {0,0,0,0};                            // off button
  155.     {0,0,0,0};                            // button label
  156.     };
  157. };
  158.  
  159. // Menu used to select between direct connect, AppleTalk, and Servers
  160. resource 'MENU' (-4096, sysheap, purgeable)
  161. {
  162.     -4096,
  163.     textMenuProc,
  164.     0xFFFFFFFF,    
  165.     enabled,
  166.     "",
  167.     {
  168.     }
  169. };
  170.  
  171. // Pop-up control used to select between direct connect printers and those being shared on the network
  172. resource 'CNTL' (-4096, sysheap, purgeable)
  173. {
  174.     {0, 0, 20, 213},                            // zero based control location
  175.     0,                                                // Title options 0 = Left justified
  176.     visible,                                        // Should we display the control?
  177.     95,                                            // Title Width
  178.     -4096,                                        // 'MENU' to display
  179.     popupMenuCDEFproc+popupFixedWidth,    // CDEF = CDEFID * 16 + varCode
  180.     0,                                             // refCon = ResType to append = None
  181.     "Connect via:"                                // Control title
  182. };
  183.  
  184. resource 'DITL' (-4096, sysheap, purgeable) 
  185. {
  186.     {
  187.         {3, 238, 23, 238 + 213}, 
  188.             Control {enabled, -4096},
  189.     };
  190. };
  191.  
  192.  
  193. resource 'DITL' (-4095, sysheap, purgeable) {
  194.     {    /* array DITLarray: 2 elements */
  195.         /* [1] */
  196.         {143, 310, 163, 368},
  197.         Button {
  198.             enabled,
  199.             "OK"
  200.         },
  201.         /* [2] */
  202.         {23, 87, 119, 377},
  203.         StaticText {
  204.             disabled,
  205.             "This printer driver could not be used.\n\n"
  206.             "Quitting one or more applications and then "
  207.             "trying again may allow you to use this "
  208.             "printer driver."
  209.         }
  210.     }
  211. };
  212.  
  213. resource 'ALRT' (-4095, sysheap, purgeable) {
  214.     {30, 30, 30+175, 30+380},
  215.     -4095,
  216.     {    /* array: 4 elements */
  217.         /* [1] */
  218.         OK, visible, sound1,
  219.         /* [2] */
  220.         OK, visible, sound1,
  221.         /* [3] */
  222.         OK, visible, sound1,
  223.         /* [4] */
  224.         OK, visible, sound1
  225.     },
  226.     alertPositionParentWindowScreen
  227. };
  228.  
  229. //-----------------------------------------------------------------------------------
  230. // CHOOSER PACK HELP RESOURCES
  231. //-----------------------------------------------------------------------------------
  232.  
  233.  
  234. /*    Any Chooser package can get balloons on all items that are normally 
  235.     added to the Chooser dialog by containing a STR# resource of 
  236.     resource ID = PackResID (-5694) and following the convention below:
  237.         
  238.         resource 'STR#' (-5694, sysheap, purgeable) {
  239.           {        "kEnabledLeftButton";    // message for button (or control) that is Enabled but not checked
  240.                 "kDisabledLeftButton";    // message for the control that is Disabled
  241.                 "kCheckedLeftButton";    // message for the control that is Checked (ie CtrlValue>0)
  242.                 "kOtherLeftButton";        // message for the control that is Other (ie CtrlValue>1)
  243.                 "kEnabledRightButton";
  244.                 "kDisabledRightButton";
  245.                 "kCheckedRightButton";
  246.                 "kOtherRightButton";
  247.                 "kEnabledOnButton";
  248.                 "kDisabledOnButton";
  249.                 "kCheckedOnButton";
  250.                 "kOtherOnButton";
  251.                 "kEnabledOffButton";
  252.                 "kDisabledOffButton";
  253.                 "kCheckedOffButton";
  254.                 "kOtherOffButton";
  255.                 "kEnabledOnOffTitle";
  256.                 "kDisabledOnOffTitle";
  257.                 "kCheckedOnOffTitle";
  258.                 "kOtherOnOffTitle";
  259.           }
  260.         };
  261.         
  262.     This is a horrible Chooser hack for 7.0 - but we'll follow along in GX.
  263. */
  264.  
  265. resource 'STR#' (-5694, sysheap, purgeable) {
  266.   {        
  267.   
  268.           "Click here to create a desktop printer for the selected device."; // message for button (or control) that is Enabled but not checked
  269.         "You have not selected a device to create, or there is not enough memory to create a desktop printer at this time.";    // message for the control that is Disabled
  270.         "";    // message for the control that is Checked (ie CtrlValue>0)
  271.         "";    // message for the control that is Other (ie CtrlValue>1)
  272.         "";    // kEnabledRightButton
  273.         "";    // kDisabledRightButton
  274.         "";    // kCheckedRightButton
  275.         "";    // kOtherRightButton
  276.         "Use this pop–up menu to select the type of connection for the desktop printer you are creating.";
  277.         "";    // kDisabledOnButton
  278.         "";    // kCheckedOnButton 
  279.         "";    // kOtherOnButton
  280.         "";    // kEnabledOffButton
  281.         "";    // kDisabledOffButton
  282.         "";    // kCheckedOffButton
  283.         "";    // kOtherOffButton
  284.         "";    // kEnabledOnOffTitle
  285.         "";    // kDisabledOnOffTitle
  286.         "";    // kCheckedOnOffTitle
  287.         "";    // kOtherOnOffTitle
  288.   }
  289. };
  290.  
  291.